<%-- 
    Document   : phieumuahangcontent
    Created on : Oct 5, 2011, 6:14:34 PM
    Author     : Administrator
--%>

<%@page import="hibernate.pojo.Sanpham"%>
<%@page import="hibernate.pojo.Dondathang"%>
<%@page import="hibernate.pojo.Khachhang"%>
<%@page import="java.util.List"%>
<%@page import="hibernate.pojo.Chitietdondathang"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Zing Deal | Xem giỏ hàng Deal</title>
        <link href="DealZing_files/6aad5646.css" rel="stylesheet" type="text/css" />
        <link href="DealZing_files/67c1986db3a007b5334d560ed8583f36_2010110100.css" rel="stylesheet" type="text/css" />
    </head>
    <%
        try {
            Khachhang khachHang = (Khachhang) session.getAttribute("KhachHang");
            List<Chitietdondathang> lstCtddh = (List<Chitietdondathang>) request.getAttribute("PhieuMuaHang");
    %> 
    <body>
        <div id="subContent">
            <div id="subMainContent1">
                <div id="static">
                    <div class="StaticTopPanel">
                        <h2 class="TitleMain">Phiếu mua hàng</h2>                           
                    </div>
                    <!-- End .StaticTopPanel -->

                    <div class="OuterContent">
                        <div class="InnerContent">
                            <div class="StaticMain">
                                <ul id="tabHeader">
                                    <li class="Active"><a href="listdealboughtcontroller?action=listdealbought" title="Phiếu mua hàng"><span>Phiếu mua hàng</span></a></li>
                                    <li><a href="listdealboughtcontroller?action=listdealdelivery" title="Phiếu giao hàng"><span>Phiếu giao hàng</span></a></li>
                                    <li><a href="listdealboughtcontroller?action=listdealtransactions" title="Lịch sử giao dịch"><span>Lịch sử giao dịch</span></a></li>
                                </ul>

                                <div class="ContentBlock">
                                    <form name="frmPhieuMuaHang" class="frmNapThe frmQLDH" id="DealUserIndexForm" method="post" action="searchordercontroller?action=searchorder">
                                        <ul>
                                            <li>
                                                <p>
                                                    <label class="RegMaphieu">Mã phiếu</label>
                                                    <input name="txt_maphieu" type="text" maxlength="225" value="" id="DealUserCouponCode" />                            
                                                    <input type="submit" class="BtnTimMa" value="" style="width:60px; height: 23px; background:url(DealZing_files/tim-ma-small.png) no-repeat;"/>
                                                </p>
                                            </li>                                              
                                        </ul>
                                    </form>                  

                                    <table width="100%" cellspacing="0" cellpadding="0" class="MyTable MyTableQLDH">
                                        <thead>
                                            <tr>
                                                <th>Ngày Mua</th>
                                                <th>Mã phiếu</th>
                                                <th>Deal</th>
                                                <th>Số lượng</th>
                                                <th>Giá Mua</th>
                                            </tr>
                                        </thead>
                                        <!-- donhang -->
                                        <%
                                            for (int i = 0; i < lstCtddh.size(); i++) {
                                                Chitietdondathang ctddh = lstCtddh.get(i);
                                                Dondathang dondh = ctddh.getDondathang();
                                                Sanpham sanpham = ctddh.getSanpham();

                                        %>

                                        <tbody>
                                            <%if (i % 2 == 0) {%>
                                            <tr class="OddRow">
                                                <td class="HorzCenter"><span class="c" title="<%=dondh.getNgayDat()%>"><%=dondh.getNgayDat()%></span></td>
                                                <td class="HorzLeft">
                                                    <span class="c"><%=ctddh.getMaChiTietDonDatHang()%></span>                         </td>
                                                <td class="HorzLeft">
                                                    <a href="dealdetailcontroller?action=viewdealdetail&amp;state=opening&amp;maSanPham=<%=sanpham.getMaSanPham()%>" title="<%=sanpham.getTieuDeSanPham()%>"><%=sanpham.getTenSanPham()%></a>  </td>
                                                <td class="HorzCenter"><span class="c" title=""><%=ctddh.getSoLuongDat()%></span></td>
                                                <td class="HorzCenter"><%=ctddh.getDonGiaBan()%></td>						  
                                            </tr>
                                            <%} else {%>
                                            <tr class="EvenRow">
                                                <td class="HorzCenter"><span class="c" title="<%=dondh.getNgayDat()%>"><%=dondh.getNgayDat()%></span></td>
                                                <td class="HorzLeft">
                                                    <span class="c"><%=ctddh.getMaChiTietDonDatHang()%></span>                         </td>
                                                <td class="HorzLeft">
                                                    <a href="dealdetailcontroller?action=viewdealdetail&amp;state=opening&amp;maSanPham=<%=sanpham.getMaSanPham()%>" title="<%=sanpham.getTieuDeSanPham()%>"><%=sanpham.getTenSanPham()%></a>  </td>
                                                <td class="HorzCenter"><span class="c" title=""><%=ctddh.getSoLuongDat()%></span></td>
                                                <td class="HorzCenter"><%=ctddh.getDonGiaBan()%></td>						  
                                            </tr>
                                            <%}%>
                                        </tbody>
                                        <%}%>
                                    </table>
                                    <!-- Ket thuc donhang -->
                                    <div class="PagingWrapper">
                                        <div class="PageControl">
                                            <ul class="PageList">
                                                <span class="PagingFirstPageLnk">&laquo; Trước</span>
                                                <span class="PagingNextPageLnk">Tiếp theo &raquo;</span>
                                            </ul>
                                        </div>
                                    </div>						
                                </div>
                                <!-- End .ContentBlock -->
                            </div>
                            <!-- End .StaticMain -->
                        </div>
                        <!-- End .InnerContent -->
                    </div>
                    <!-- End .OuterContent -->
                </div>
                <!-- End #static -->
                <div class="botSubContent1"></div>
            </div>
        </div>
    </body>
    <%
        } catch (Exception ex) {
            System.err.print(ex);
        }
    %>
</html>
